-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfix 1798 main_v10.0 py_grid_string #1799
Bugfix 1798 main_v10.0 py_grid_string #1799
Conversation
…string or dictionary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I replicated the problem described in issue #1798 and confirm that these changes fix the problem, and I approve this request.
First ran without MET_PYTHON_EXE set and got a successful run:
/usr/local/met-10.0.0/bin/plot_data_plane PYTHON_NUMPY plot.ps 'name="read_ascii_numpy_named_grid.py data/python/fcst.txt FCST";'
DEBUG 1: Opening data file: PYTHON_NUMPY
Python Script: 'read_ascii_numpy_named_grid.py'
Input File: 'data/python/fcst.txt'
Data Name: 'FCST'
Data Shape: (129, 185)
Data Type: dtype('float64')
Attributes: {'valid': '20050807_120000', 'init': '20050807_000000', 'lead': '120000', 'accum': '120000', 'name': 'FCST', 'long_name': 'FCST_word', 'level': 'Surface', 'units': 'None', 'grid': 'G212'}
DEBUG 1: Creating postscript file: plot.ps
Then set MET_PYTHON_EXE and ran again and did not get a successful run:
setenv MET_PYTHON_EXE `which python3`
/usr/local/met-10.0.0/bin/plot_data_plane PYTHON_NUMPY plot.ps 'name="read_ascii_numpy_named_grid.py data/python/fcst.txt FCST";'
DEBUG 1: Opening data file: PYTHON_NUMPY
Python Script: '/usr/local/met-10.0.0/share/met/wrappers/write_tmp_dataplane.py'
User Command: 'read_ascii_numpy_named_grid data/python/fcst.txt FCST'
Temporary File: '/tmp/tmp_met_nc_39904_0'
Python Script: 'read_ascii_numpy_named_grid'
Input File: 'data/python/fcst.txt'
Data Name: 'FCST'
Data Shape: (129, 185)
Data Type: dtype('float64')
Attributes: {'valid': '20050807_120000', 'init': '20050807_000000', 'lead': '120000', 'accum': '120000', 'name': 'FCST', 'long_name': 'FCST_word', 'level': 'Surface', 'units': 'None', 'grid': 'G212'}
Traceback (most recent call last):
File "/usr/local/met-10.0.0/share/met/wrappers/read_tmp_dataplane.py", line 23, in <module>
grid_attr = attr.split('.')[1]
IndexError: list index out of range
WARNING:
WARNING: tmp_nc_dataplane() -> an error occurred importing module "read_tmp_dataplane"
WARNING:
ERROR :
ERROR : plot_data_plane -> trouble getting field "name="read_ascii_numpy_named_grid.py data/python/fcst.txt FCST";" from file "PYTHON_NUMPY"
ERROR :
Then, using the new code, I reran with MET_PYTHON_EXE set and saw the problem was resolved:
/d1/projects/MET/MET_pull_requests/met-10.0.1/bugfix_1798/MET-bugfix_1798_main_v10.0_py_grid_string_into_main_v10.0/met/bin/plot_data_plane PYTHON_NUMPY plot.ps 'name="read_ascii_numpy_named_grid.py data/python/fcst.txt FCST";'
DEBUG 1: Opening data file: PYTHON_NUMPY
Python Script: '/d1/projects/MET/MET_pull_requests/met-10.0.1/bugfix_1798/MET-bugfix_1798_main_v10.0_py_grid_string_into_main_v10.0/met/share/met/wrappers/write_tmp_dataplane.py'
User Command: 'read_ascii_numpy_named_grid data/python/fcst.txt FCST'
Temporary File: '/tmp/tmp_met_nc_40024_0'
Python Script: 'read_ascii_numpy_named_grid'
Input File: 'data/python/fcst.txt'
Data Name: 'FCST'
Data Shape: (129, 185)
Data Type: dtype('float64')
Attributes: {'valid': '20050807_120000', 'init': '20050807_000000', 'lead': '120000', 'accum': '120000', 'name': 'FCST', 'long_name': 'FCST_word', 'level': 'Surface', 'units': 'None', 'grid': 'G212'}
DEBUG 1: Creating postscript file: plot.ps
* Per #1789, remove duplicate plot_point_obs configuration section. (#1790) * Per #1798, fix up the read_tmpe_dataplane.py script to handle a grid string or dictionary. (#1799) * Github Issue #1801: Comment out code that checks for BEST track to support extra-tropical cyclone tracks not verified against BEST tracks. * Bugfix 1395 main_v10.0 comp script (#1796) * Updating compile script and associated config files for met-10.0.0 * Removing old config files * install_met_env.het * Updated orion file * Added stampede2 config file * Adding modulefiles for various machines * Feature main_v10.0 bugfix_checklist (#1803) * Recommended updates to clarify the use of projects and milestones for bugfixes. * Making details consistent across all issue templates. * Per met-help question (https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=99964) clarify the description of the obs_thresh option. * Update README.md Adding text for GitHub Discussions * changed non-unicode apostrophe and fixed typo in URL (#1813) * Correct formatting errors in release notes. * #1817 Added to_north argument at two_to_one() * #1817 Calls two_to_one() with false for the third argument, if latitude moves north to south * #1508 checking stat() methoid returns no error before looking at FILE flag Co-authored-by: bikegeek <minnawin@ucar.edu> Co-authored-by: jprestop <jpresto@ucar.edu> Co-authored-by: bikegeek <3753118+bikegeek@users.noreply.github.com> Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com> Co-authored-by: Howard Soh <hsoh@kiowa.rap.ucar.edu> Co-authored-by: hsoh-u <hsoh@ucar.edu>
Pull Request Testing
Describe testing already performed for these changes:
Manually tested and confirmed that these changes enable python embedding to work in this case.
Recommend testing for the reviewer(s) to perform, including the location of input datasets, and any additional instructions:
Replicate the problem described in issue Fix python embedding when using a named grid with MET_PYTHON_EXE set. #1798 and confirm that these changes fix the problem.
Do these changes include sufficient documentation updates, ensuring that no errors or warnings exist in the build of the documentation? [Yes]
No doc updates required for this bugfix.
Do these changes include sufficient testing updates? [Yes]
I made no updates to tests on the main_v10.0 branch but will update them on the develop branch.
Will this PR result in changes to the test suite? [No]
If yes, describe the new output and/or changes to the existing output:
Please complete this pull request review by [5/21/21].
Pull Request Checklist
See the METplus Workflow for details.
Select: Reviewer(s), Project(s), and Milestone